package view;

import java.awt.BorderLayout;
import java.awt.Dimension;

import javax.swing.JPanel;

import model.State;

/**
 * Class to create a center panel to properly diplay the conference and role
 * @author Sarah George
 * @version Autumn 2012
 */
@SuppressWarnings("serial")
public class CenterPanel extends JPanel {
	
	/**
	 * The State of the system.
	 */
	private State my_state;
	
	/**
	 * Constructor for the center panel.
	 * @param the_state the current state of the system.
	 */
	public CenterPanel(State the_state) {
		super();
		my_state = the_state;
		setPreferredSize(new Dimension(500, 150));
		setup();
	}

	/**
	 * Method to setup the center panel.
	 */
	public void setup() {
		ConfListPanel clp = new ConfListPanel();
		RoleListPanel rlp = new RoleListPanel();
		my_state.addObserver(rlp);
		my_state.addObserver(clp);
		this.add(clp, BorderLayout.NORTH);
		this.add(rlp, BorderLayout.SOUTH);
	}
}//End class center panel.